/**********************************************************************************
// Background Header File
// 
// Creation:	01 Mai 2011
// Updated:		01 Mai 2011
// Compiler:	Visual Studio 2010
//
// Notes:		Defines a background image handler
//				The background does not support transparency
//
**********************************************************************************/

#ifndef _ANABELE_BACKGROUND_H_
#define _ANABELE_BACKGROUND_H_

// make classes and functions exportable to a DLL
#ifdef ANABELE_EXPORTS
#define DLL __declspec( dllexport )
#else
#define DLL __declspec( dllimport )
#endif

/**********************************************************************************/

#include <d3dx9.h>			// Direct 3D Extensions
#include "Color.h"          // Engine color type
#include "Types.h"			// Engine custom types

/**********************************************************************************/

class DLL Background
{
private:
	LPDIRECT3DSURFACE9 background;	// direct3d surface for background
	uint width;						// sprite width
	uint height;					// sprite height

public:
	Background(char * filename, Color colorKey = Color(255,0,255));

	Background(char * filename, uint tileWidth, uint tileHeight, uint numColumns, 
		int * tileMap, uint tileMapCols, uint tileMapRows, Color colorKey = Color(255,0,255));
	
	~Background();					

	void Draw(RECT & sourceRect);	// draw the background onscreen
	uint GetWidth();				// get width of the background
    uint GetHeight();				// get height of the background
}; 

/**********************************************************************************/
// InLine Member Functions

inline uint Background::GetWidth()
{ return width; }

inline uint Background::GetHeight()
{ return height; }

/**********************************************************************************/


#endif